Console Objects Fields and Methods Quick Reference Part 5
This quick reference guide was taken directly out of The Game Programmer's Guide to Torque by Edward Maurina. It's an outstanding resource - a must for anyone wanting to get serious about programming in Torque.
fxSunLight
|
This class is used to represent celestial bodies. You may defined as many fxSunlight objects as you need in your seeing. Each object may be animated independently. As a whole, this class provides several features allowing us to represent a variety of celestial bodies with many different behaviors.
Fields
| Field Name |
Description |
Sample or Range |
| AnimAzimuth |
Enable azimuth animation. |
[ false , true ] |
| AnimBrightness |
Enable brightness animation. |
[ false , true ] |
| AnimColour |
Enable color animation. |
[ false , true ] |
| AnimElevation |
Enable elevation animation. |
[ false , true ] |
| AnimRotation |
Enable rotation animation. |
[ false , true ] |
| AnimSize |
Enable size animation. |
[ false , true ] |
| AzimuthKeys |
Key frame values for azimuth animation. |
“ABCDABCD” |
| AzimuthTime |
Round-trip animation time for azimuth. |
[ 0.0 , inf.0 ) |
| BlendMode |
0 = GL_SRC_ALPHA, GL_ONE
1 = GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA
2 = GL_ONE, GL_ONE
|
[ 0 , 2 ] |
| BlueKeys |
Key frame values for blue channel animation. |
“ABCDABCD” |
| Brightness |
Starting brightness. |
[ 0.0 , inf.0 ) |
| BrightnessKeys |
Key frame values for brightness animation. |
“ABCDABCD” |
| BrightnessTime |
Round-trip animation time for brightness. |
[ 0.0 , inf.0 ) |
| Colour |
Initial color. |
“1.0 1.0 0.0 1.0” |
| ColourTime |
Round-trip animation time for color. |
[ 0.0 , inf.0 ) |
| ElevationKeys |
Key frame values for elevation animation. |
“ABCDABCD” |
| ElevationTime |
Round-trip animation time for elevation. |
[ 0.0 , inf.0 ) |
| Enable |
Enable or disable fxSunlight object rendering. |
[ false , true ] |
| FadeTime |
Round-trip animation time for fade. |
[ 0.0 , inf.0 ) |
| FlareSize |
Size for flare bitmap. |
[ 0.0 , inf.0 ) |
| FlareTP |
If true, enables flare in third person. |
[ false , true ] |
| GreenKeys |
Key frame values for green channel animation. |
“ABCDABCD” |
| LerpAzimuth |
Enable azimuth interpolation. |
[ false , true ] |
| LerpBrightness |
Enable brightness interpolation. |
[ false , true ] |
| LerpColour |
Enable color interpolation. |
[ false , true ] |
| LerpElevation |
Enable elevationr interpolation. |
[ false , true ] |
| LerpRotation |
Enable rotation interpolation. |
[ false , true ] |
| LerpSize |
Enable size interpolation. |
[ false , true ] |
| LinkFlareSize |
Flag controlling whether the flare is linked to the light by size. If on then the flare tracks the color & brightness settings of the light to control its size. The brighter the light, the larger the flare. The flare is scaled according to it's current animation e.g. it never gets any bigger than it would with this setting off. |
[ false , true ] |
| LocalFlareBitmap |
Lens flare texture. |
~/path/filename.png |
| LockToRealSun |
Elevation and azimuth for this object follows elevation and azimuth for Sun object. |
[ false , true ] |
| MaxAzimuth |
Maximum azimuth setting. |
[ 0.0 , 360.0 ) |
| MaxBrightness |
Maximum brightness when brightness animation is enabled. |
[ 0.0 , inf.0 ) |
| MaxColour |
Maximum color when color animation is enabled. |
|
| MaxElevation |
Maximum elevation. |
[ -90.0 , 90.0 ] |
| MaxRotation |
Maximum rotation when rotation animation is enabled. |
[ 0.0 , 360.0 ) |
| MaxSize |
Maximum size for flare. |
[ 0.0 , inf.0 ) |
| MinAzimuth |
Minimum azimuth setting. |
[ 0.0 , 360.0 ) |
| MinBrightness |
Minimum brightness when brightness animation is enabled. |
[ 0.0 , inf.0 ) |
| MinColour |
Minimum color when color animation is enabled. |
“0.0 0.0 1.0 1.0” |
| MinElevation |
Minimum elevation setting. |
[ -90.0 90.0 ] |
| MinRotation |
Minimum rotation when rotation animation is enabled. |
[ 0.0 , 360.0 ) |
| MinSize |
Minimum flare size. |
[ 0.0 , inf.0 ) |
| NearDistance |
Distance from light when flare achieves screen size of NearSize. |
[ 0.0 , inf.0 ) |
| NearSize |
Screen size for flare at NearDistance and closer. |
[ 0.0 , inf.0 ) |
| OffsetKeys |
Key frame values for offset animation. |
“ABCDABCD” |
| OffsetTime |
Round-trip animation time for offset. |
[ 0.0 , inf.0 ) |
| RedKeys |
Key frame values for red channel animation. |
“ABCDABCD” |
| RemoteFlareBitmap |
The sun texture. |
~/path/filename.png |
| RotationKeys |
Key frame values for rotation animation. |
“ABCDABCD” |
| RotationTime |
Round-trip animation time for rotation. |
[ 0.0 , inf.0 ) |
| SingleColourKeys |
Use RedKeys to animate all colors at the same time. |
“ABCDABCD” |
| SizeKeys |
Key frame values for size animation. |
“ABCDABCD” |
| SizeTime |
Round-trip animation time for size. |
[ 0.0 , inf.0 ) |
| SunAzimuth |
Initial azimuth setting. |
[ 0.0 , 360.0 ) |
| SunElevation |
Initial elevation setting. |
[ -90.0 , 90.0 ] |
Console Method Summaries
Long descriptions for these functions have not been supplied because the functions are very simple and their names are quite descriptive.
| reset() |
setAzimuthKeys( keys ) |
setAzimuthTime( time ) |
| setBlendMode( mode ) |
setBlueKeys( keys ) |
setBrightnessKeys( keys ) |
| setBrightnessTime( time ) |
setColourTime( time ) |
setElevationKeys( keys ) |
| setElevationTime( time ) |
setEnable( status ) |
setFadeTime( time ) |
| setFlareBitmaps( local , remote ) |
setFlareBrightness( brightness ) |
setFlareColour( r , g , b ) |
| setFlareSize( size ) |
setFlareTP( status ) |
setGreenKeys( keys ) |
| setLerpAzimuth( status ) |
setLerpBrightness( status ) |
setLerpColour( status ) |
| setLerpElevation( status ) |
setLerpRotation( status ) |
setLerpSize( status ) |
| setLinkFlareSize( status ) |
setMaxAzimuth( azimuth ) |
setMaxBrightness( brightness ) |
| setMaxColour( r , g , b ) |
setMaxElevation( elevation ) |
setMaxRotation( rotation ) |
| setMaxSize( size ) |
setMinAzimuth( azimuth ) |
setMinBrightness( brightness ) |
| setMinColour( r , g , b ) |
setMinElevation( elevation ) |
setMinRotation( rotation ) |
| setMinSize( size ) |
setRedKeys( keys ) |
setRotationKeys( keys ) |
| setRotationTime( time ) |
setSingleColourKeys( status ) |
setSizeKeys( keys ) |
| setSizeTime( time ) |
setSunAzimuth( azimuth ) |
setSunElevation( elevation ) |
| setUseAzimuth( status ) |
setUseBrightness( status ) |
setUseColour( status ) |
| setUseElevation( status ) |
setUseRotation( status ) |
setUseSize( status ) |
GameBase
This is the base class to all classes using or requiring a data block. This class can be considered virtual as you do not create instances of it in the game world.
Fields
| Field Name |
Description |
Sample or Range |
| dataBlock |
The corresponding data block for this object. |
GameBaseData datablock |
Globals
| Variable Name |
Description |
Sample or Range |
| $gameBase::boundingBox |
If true, objects will display their bounding boxes. |
[ false , true ] |
Console Method Summaries
| getDataBlock |
setDataBlock |
Console Methods
|
getDataBlock()
|
|
Purpose
Use the getDataBlock method to get the datablock used by this object.
Returns
No return value.
See Also
setDataBlock
|
|
setDataBlock( db )
|
|
Purpose
Use the setDataBlock method to change the datablock for this object to a new datablock represented by db.
Syntax
db – A datablock name or ID.
Returns
Returns true if the datablock with successfully changed, otherwise it returns false.
Notes
The new datablock must be of a compatible type with the current class.
See Also
getDataBlock
|
GameBaseData
This class is the corresponding data block the gamebase. It can be considered virtual also.
Fields
| Field Name |
Description |
Sample or Range |
| category |
Creator category to place this object in. |
“MyCategory” |
| className |
A new namespace to be inserted between the name of the data block and the class name of the data block. |
“SomeClassname” |
GameConnection
A class connecting the client in the current executable to a server in the current executable or to a server and external executable.
Console Method Summaries
| activateGhosting |
chaseCam |
clearCameraObject |
| delete |
getCameraObject |
getControlCameraFov |
| getControlObject |
getServerConnection |
isAIControlled |
| isDemoPlaying |
isDemoRecording |
isFirstPerson |
| listClassIDs |
play2D |
play3D |
| playDemo |
resetGhosting |
setBlackOut |
| setCameraObject |
setConnectArgs |
setControlCameraFov |
| setControlObject |
setFirstPerson |
setJoinPassword |
| setMissionCRC |
startRecording |
stopRecording |
Console Methods
|
activateGhosting()
|
|
Purpose
Use the activateGhosting method to GameConnection instance to start ghosting objects to the client.
Returns
No return value.
Notes
This is called on each client connection by the server.
See Also
resetGhosting
|
|
chaseCam( delay )
|
|
Purpose
Use the chaseCam method to insert a delay in between translations and rotations of the control object and the attached 3rd POV camera. That is, if delay is a positive non-zero value, the camera will lag behind translations and rotations of the 3rd POV player.
Syntax
delay – An integer value equal to or greater than zero. If this value is greater than zero, the camera will begin to lag the players translations and rotations.
Notes
This can quickly become disconcerting as it disconnects player input from the results. Use this feature cautiously.
|
|
delete( [ reason ] )
|
|
Purpose
Use the delete method to destroy and disconnect the current connection, giving an optional reason. If reason is specified, it will be transmitted to the client/server on the other end of the connection.
Syntax
reason – A string explaining while the connection is being severed.
Returns
No return value.
|
|
getCameraObject()
|
|
Purpose
Use the getCameraObject method to get the current camera object ID.
Returns
Returns the ID of the current camera object, or the control object if the POV is first person.
See Also
setCameraObject()
|
|
getControlCameraFov()
|
|
Purpose
Use the getControlCameraFov method to FOV of the current control 'camera'.
Returns
Returns a FOV angle between 0.0 and 180.0.
Notes
This may not actually be the FOV of the camera object, but rather the FOV being used by the camera. The difference is subtle, but if a camea is attached to an object and using that object's FOV setting, then the FOV is actually coming from the object, not the camera.
See Also
getCameraObject, setControlCameraFov
|
|
getControlObject()
|
|
Purpose
Use the getControlObject method to get the ID of the current control-object for this GameConnection.
Returns
Returns an integer value representing the ID of an object acting as the control-object for this GameConnection. If no control-object was set up, this will return 0.
|
|
getServerConnection()
|
|
Purpose
Use the getServerConnection method to get the ID of the server this client-side GameConnection is attached to.
Returns
Returns an integer representing the ID of a server-side GameConnection on the other end of this client-side GameConnection. If no server is connected, or if this GameConnection is a server-side connection, the return value is 0.
|
|
isAIControlled()
|
|
Purpose
Use the isAIControlled method to determine if this is an AIGameConnection.
Returns
Returns true if this is an AIGameConnection instance.
Notes
This will always return false for a GameConnection and always return true for an AIGameConnection. It was defined here to allow scripts to call it universally on either type of connection.
|
|
isDemoPlaying()
|
|
Purpose
Use the isDemoPlaying method to see if this GameConnection is playing a demo.
Returns
Returns true if a demo is being played, false otherwise.
See Also
isDemoRecording, playDemo, startRecording, stopRecording
|
|
isDemoRecording()
|
|
Purpose
Use the isDemoRecording method to see if this GameConnection is recording a demo.
Returns
Returns true if a demo is being recorded, false otherwise.
See Also
isDemoPlaying, playDemo, startRecording, stopRecording
|
|
isFirstPerson()
|
|
Purpose
Use the isFirstPerson method to see if the camera attached to this GameConnection is in 1st POV.
Returns
Returns true if the camera attached to this GameConnection is in 1st POV, false otherwise.
See Also
setFirstPerson
|
|
listClassIDs()
|
|
Purpose
Use the listClassIDs method to dump a list of all class IDs that this GameConnection knows about.
Returns
No return value.
Notes
This is a debug feature.
|
|
play2D( AP )
|
|
Purpose
Use the play2D method to play a 2D AudioProfile previously specified using the datablock keyword.
Syntax
AP – A 2D AudioProfile previously specified using the datablock keyword.
Returns
Returns true if the sound can be played, false otherwise.
Notes
Be sure to use only AudioProfiles created using the datablock keyword.
See Also
play3D
|
|
play3D( AP , position )
|
|
Purpose
Use the play2D method to play a 3D AudioProfile previously specified using the datablock keyword.
Syntax
AP – A 3D AudioProfile previously specified using the datablock keyword.
position – The position to play this sound at.
Returns
Returns true if the sound can be played, false otherwise.
Notes
Be sure to use only AudioProfiles created using the datablock keyword.
See Also
play2D
|
|
playDemo( demoFileName )
|
|
Purpose
Use the playDemo method to play a previously recorded demo on this GameConnection.
Syntax
demoFileName – A path and file name pointing to a previously recorded demo.
Returns
Returns true if the demo was succesfully played, false otherwise.
See Also
isDemoPlaying, isDemoRecording, startRecording, stopRecording
|
|
resetGhosting()
|
|
Purpose
Use the resetGhosting method to reset ghosting. This in effect tells the server to resend each ghost to insure that all objects which should be ghosts and are in fact ghosted.
Returns
No return value.
See Also
activateGhosting
|
|
setBlackOut( doFade , timeMS )
|
|
Purpose
Use the setBlackOut method to fade (black) the screen out, or in.
Syntax
doFade – A boolean value. If set to true, the screen is blacked out, if false, the blackout is reversed.
timeMS – An integer value specifying the time it takes to fade-out or to fade back in.
Returns
No return value.
Notes
This is only called on the client-side GameConnection (from client to server), calling in on a server-side connection (from server to client), will do nothing.
The GameBase class provides two similar features for whiting out the screen and causing damage flashes.
|
|
setCameraObject( newCamera )
|
|
Purpose
Use the setCameraObject method to change the camera object associated with this GameConnection to newCamera.
Syntax
newCamera – The ID of a valid camera object.
Returns
Returns true on success and false on failure.
Notes
This can only be called on the serer-side GameConnection.
See Also
getCameraObject
|
|
setConnectArgs( name [ , arg1 , ... , arg15 ] )
|
|
Purpose
Use the setConnectArgs method to set the connection arguments for this client-side GameConnection. These values will be passed to the server upon establishing a connection.
Syntax
name – Generally, the first argument is the name of the player.
arg1 , ... , arg15 – 15 additional arguments may be passed.
Returns
No return value.
See Also
setJoinPassword
|
Table of Contents || Part 1 || Part 2 || Part 3 || Part 4 || Part 6 || Part 7 || Part 8 || Part 9 || Part 10 || Part 11 || Part 12 || Part 13 || Part 14 || Part 15
|